<template>
  <div>
    <el-breadcrumb separator="/">
        <el-breadcrumb-item style="cursor:pointer;" :to="{ path: '/TestRecordDatas',query:{instanceId: instanceId, testNumber: testNumber, pk_ch_name: pk_ch_name, tplt_name: tplt_name, testDate: testDate,review_status: review_status} }"><span style="cursor:pointer;">返回</span></el-breadcrumb-item>
    </el-breadcrumb>
    <div class="info">
      <el-card class="box-card">
        <div class="header">公共参数</div>
        <el-row>
          <el-col :span="8" style="display: flex">委试号：{{testNumber}}</el-col>
          <el-col :span="8">选择工位：{{station_name}}</el-col>
          <el-col :span="8">试品名称：{{pk_ch_name}}</el-col>
        </el-row>
        <el-row>
          <el-col :span="8">相对湿度(%RH)：{{RH}}</el-col>
          <el-col :span="8">大气压(kPa)：{{ATM}}</el-col>
          <el-col :span="8"> 温度(℃)：{{T}}</el-col>
        </el-row>
        <el-row>
          <el-col :span="8">是否充气：{{ifInflate === '0' ? '否' : '是'}}</el-col>
          <el-col :span="8">充气类型：{{ifInflate === '0' ? '--' : gasKind }}</el-col>
          <el-col :span="8">充气压力(MPa)：{{ifInflate === '0' ? '--' : setPress}}</el-col>
        </el-row>
        <el-row>
          <el-col :span="16">试验类型：{{testKind}}</el-col>
          <el-col :span="8">试验依据标准：{{standardStr}}</el-col>
        </el-row>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      instanceId: this.$route.query.instanceId,
      testNumber: this.$route.query.testNumber,
      pk_ch_name: this.$route.query.pk_ch_name,
      tplt_name: this.$route.query.tplt_name,
      testDate: this.$route.query.testDate,
      review_status: this.$route.query.review_status,
      station_name: '',
      data: null,
      ATM: 0, // 大气压
      RH: 0, // 相对湿度
      T: 0, // 温度
      Kam: 0,
      gasKind: '',
      ifInflate: '',
      seaLevel: '',
      setPress:'',
      standardStr:'',
      testKind:'',
    }
  },
  methods: {
    async getTestAllParam() {
      const { result } = await this.$http.get(`/testRecordData/getTestAllParam?instanceId=${this.instanceId}&testNumber=${this.testNumber}`)
      this.ATM = result.ATM
      this.Kam = result.Kam
      this.RH = result.RH
      this.T = result.T
      this.gasKind = result.gasKind
      this.ifInflate = result.ifInflate
      this.seaLevel = result.seaLevel
      this.setPress = result.setPress
      this.standardStr = result.standardStr
      this.station_name = result.stationName
      this.testKind = result.testKind
      this.testNumber = result.testNumber
    },
    async getTestEquipParam() {
      const { result } = await this.$http.get(`/testRecordData/getTestEquipParam?instanceId=${this.instanceId}`)
      // console.log(result);
      this.data = result
    }
  },
  created() {
    //获得试验的全部参数
    this.getTestAllParam()
    this.getTestEquipParam()
  }
}
</script>

<style lang="scss" scoped>
@import "./ShowAllParameters.scss";
</style>